﻿@model ProjectManager.Models.UsersCourses
<h2>
    Add Courses</h2>
@using ((Html.BeginForm())) {
<div class="editor-label">
    Course: @Html.DropDownList("CourseID", (IEnumerable<SelectListItem>)ViewData["Courses"], new { onchange = "this.form.submit();" })   
</div>
}

<br />

@using (Html.BeginForm()) {
<h2>
    Add Users' Courses</h2>
<table>
    <tr>
        <th>
            User Name
        </th>
        <th>
            Add
        </th>
    </tr>
    @for (var i = 0; i < Model.Users.Count; ++i)
    {
        <tr>
            <td>
                @Model.Users.ToArray()[i]
            </td>
            <td>
                @Html.EditorFor(m => @Model.Check.ToArray()[i])
            </td>
        </tr>
    }
    
    <br />    
</table>
    
    <input value="Save" type="submit" />
}

<br />
<div>
    @Html.ActionLink("Back to List", "Index", "Account", null, null)
</div>
